<?php

use admin\widgets\AdminToolbar;
use admin\components\BaseGridView;

/* @var $dataProvider */
?>


<?= AdminToolbar::widget([]); ?>
<?= BaseGridView::widget([
        'dataProvider' => $dataProvider,
        'filterModel' => NULL,
        'columns' => [
            //['class' => 'yii\grid\SerialColumn'],
            //['class' => 'yii\grid\CheckboxColumn', 'headerOptions' => ['width' => '5%']],
            'id',
            ['attribute' => 'title', 'contentOptions' => ['class' => 'text-left'], 'headerOptions' => ['class' => 'text-left']],
            ['attribute' => 'image', 'format' => 'raw', 'value' => function(\app\models\Banner $model){
                return \app\helpers\AppHelper::toImage($model->image, ['style' => 'width:80px;']);
            }],
            'url:url',
            'sort',
            ['attribute' => 'status', 'format' => 'raw', 'value' => function(\app\models\Banner $model){
                return $model->_statusLabel();
            }],
            // 'ctime:datetime',
            ['class' => 'admin\components\BaseActionColumn'],
        ],
    ]); ?>
